USE [vudu]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[InsertarRolEstudiante]

	@correo Varchar(50),
	@clave Varchar(50),
	@id_Cedula int
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[ROL]
	(correo, pass,tipo_rol)
	VALUES(@correo, @clave,'Estudiante');
	update Estudiante Set estadoRol = 'Activo', fk_rol=(Select MAX(id_rol) from rol )
	where cedula = @id_Cedula;
END
GO